import request from '@/utils/request'

// 获取部门
export const getDepartment = () => request.get('/company/department')

// 获取部门负责人列表
export const getDeparmentManager = () => request.get('/sys/user/simple')

// 添加部门
// data: {code, introduce, manangerId, name, pid}
export const addDepartment = (data) => request.post('/company/department', data)

// 更新
export const updateDepartment = (data) => request.put('/company/department/' + data.id, data)

// 删除
export const delDepartment = id => request.delete('/company/department/' + id)

// 获取部门详情
export function getDepartmentDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
